package com.crm.service.home.controller;

import com.crm.model.common.dtos.ResponseResult;
import com.crm.service.home.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("/api/v1/home")
public class HomeController {
    @Autowired
    private HomeService homeService;

    /**
     * 基础数据查询
     * @param beginTime
     * @param endTime
     * @return
     */
    @GetMapping("/basic_data")
    public ResponseResult basicData(@DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate beginTime,
                                    @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endTime) {
        return homeService.basicData(beginTime, endTime);
    }

}
